"use strict";
// 获取按钮
const btns = [...document.querySelectorAll('button')];
// 背景颜色的枚举
var Color;
(function (Color) {
    Color[Color["green"] = 0] = "green";
    Color[Color["yellow"] = 1] = "yellow";
    Color[Color["skyblue"] = 2] = "skyblue";
    Color[Color["red"] = 3] = "red";
})(Color || (Color = {}));
// 添加点击事件
btns.forEach((item, idx) => {
    item.addEventListener('click', (e) => {
        //  创建弹框
        const dialogDom = document.createElement('div');
        const text = item.getAttribute('text');
        dialogDom.innerHTML = text;
        // 给创建的元素添加类名
        dialogDom.className = 'dialogBox';
        dialogDom.style.background = Color[idx];
        document.body.appendChild(dialogDom);
        setTimeout(() => {
            const dom = document.querySelector('.dialogBox');
            dom === null || dom === void 0 ? void 0 : dom.remove();
        }, 3000);
    });
});
